#frozenset
Description: Convert a value to a frozenset
.
def frozenset(x):
'''
Convert a value to a frozenset.
:param x: A variable
:return: The value converted to a frozenset
'''
Example:
print(frozenset({1, 2, 3}))
frozenset
is an immutable version ofset
. Once created, its elements cannot be changed. It is hashable and can be used as a dictionary key or added to other sets.